<%@page import="java.io.InputStreamReader"%>
<%@page import="java.io.BufferedReader"%>
<%@page import="java.io.IOException"%>
<%@page import="java.sql.SQLException"%>
<%@page import="java.io.FileReader"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>자원 읽고 웹에 출력2</title>
</head>
<body>
	<%
		String resourcePath="/data/notice.txt";
		out.print("실제경로 : "+application.getRealPath(resourcePath)+"<br>");		
		out.print("resource Path의 내용 : " + resourcePath + "<br><br>");

		BufferedReader br=null;
		String str="";
		try{
			br = new BufferedReader(new InputStreamReader(application.getResourceAsStream(resourcePath)));
			while((str=br.readLine()) != null){
				out.print(str+"<br>");
			}
		}catch(IOException e){
			out.print(e.getMessage());
		}finally {
			if(br!=null) try{ br.close(); } catch(IOException e){}
		}
	%>
</body>
</html>